import request from '../utils/request'

export default{
  //购买课程，生成订单
  buyCourse(order){
    return request({
      url:`/order/buyCourse`,
      method:'post',
      data:order
    })
  },
  //根据订单号查询订单
  getByOrderNo(orderNo){
    return request({
      url:`/order/getInfoByOrderNo/${orderNo}`,
      method:'get'
    })
  },
  //生成支付信息
  createPayInfo(orderNo){
    return request({
      url:`/paylog/createPayInfo/${orderNo}`,
      method:'get'
    })
  },
  //查询订单状态
  queryOrderStatus(orderNo){
    return request({
      url:`/paylog/queryPayStatus/${orderNo}`,
      method:'get'
    })
  },
  //查询用户是否买过课程
  isBuyCourse(courseId){
    return request({
      url:`/order/isBuyCourse/${courseId}`,
      method:'get'
    })
  }



}
